const BASE_URL = 'http://localhost:58049/Application/NewShopApi.ashx?action='   //后端给的url    http://localhost:58049    https://ypsf.huashengzhuan.cn

export const myRequest = (options) => {
	console.log('aaa'+options.url);
	return new Promise((resolve,reject)=> {
		let authtoken = uni.getStorageSync('authtoken')
		 uni.request({
			url:BASE_URL + options.url,
			data:options.data || {},
			method:options.method || 'POST',
			header:{
			    'Content-Type': 'application/x-www-form-urlencoded',
				// "X-Auth-Token": uni.getStorageSync('authtoken')  //这里的token指的是微信授权登录的token，用来判断小程序是否属于登录状态
			},
			dataType:'json',
			success:res => {
				if(res.data.code !== 1){
				}            
				resolve(res)
			},
			fail:err => {
				uni.showToast({
					title:"请求接口失败",
				})
				console.log(err)
				reject(err)
			}
		})
	}) 
}

